#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_queue_new() {
        let queue: Option<Box<Queue>> = Queue::new();
        assert!(queue.is_some());
        let queue = queue.unwrap();
        assert!(queue.is_empty());
    }

    #[test]
    fn test_queue_push_pop_head() {
        let mut queue: Option<Box<Queue>> = Queue::new().unwrap();
        assert!(queue.push_head(10));
        assert!(queue.push_head(20));
        assert_eq!(queue.peek_head(), 20);
        assert_eq!(queue.pop_head(), 20);
        assert_eq!(queue.peek_head(), 10);
        assert_eq!(queue.pop_head(), 10);
        assert!(queue.is_empty());
    }

    #[test]
    fn test_queue_push_pop_tail() {
        let mut queue: Option<Box<Queue>> = Queue::new().unwrap();
        assert!(queue.push_tail(10));
        assert!(queue.push_tail(20));
        assert_eq!(queue.peek_tail(), 20);
        assert_eq!(queue.pop_tail(), 20);
        assert_eq!(queue.peek_tail(), 10);
        assert_eq!(queue.pop_tail(), 10);
        assert!(queue.is_empty());
    }

    #[test]
    fn test_queue_free() {
        let mut queue: Option<Box<Queue>> = Queue::new().unwrap();
        queue.push_head(10);
        queue.push_head(20);
        queue.free();
        assert!(queue.is_empty());
    }

    #[test]
    fn test_queue_peek_head_and_tail() {
        let mut queue: Option<Box<Queue>> = Queue::new().unwrap();
        assert_eq!(queue.peek_head(), QUEUE_NULL);
        assert_eq!(queue.peek_tail(), QUEUE_NULL);
        queue.push_head(10);
        assert_eq!(queue.peek_head(), 10);
        queue.push_tail(20);
        assert_eq!(queue.peek_tail(), 20);
    }

    #[test]
    fn test_queue_is_empty() {
        let mut queue: Option<Box<Queue>> = Queue::new().unwrap();
        assert!(queue.is_empty());
        queue.push_head(10);
        assert!(!queue.is_empty());
        queue.pop_head();
        assert!(queue.is_empty());
    }
}